import org.springframework.aop.ThrowsAdvice;

import java.lang.reflect.Method;

/**
 * Created with IntelliJ IDEA.
 * User: ttq
 * Date: 13-8-8
 * Time: 上午9:20
 * To change this template use File | Settings | File Templates.
 */
public class ThrowsInterceptor implements ThrowsAdvice {
    public void afterThrowing(Method method, Object[] args, Object instance, AccountException ex) throws Throwable {
        System.out.println("方法" + method.getName() + "抛出了异常:" + ex);
    }

    public void afterThrowing(NullPointerException ex) throws Throwable {
        System.out.println("抛了异常:" + ex);
    }
}
